<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style type="text/css">
		ul li{
			font-size: 36px;
			line-height: 1.5em;
		}
	</style>
	<body>
		<ul>
			<li data-index="0">我是li01</li>
			<li data-index="1">我是li02</li>
			<li data-index="2">我是li03</li>
			<li data-index="3">我是li04</li>
			<li data-index="4">我是li05</li>
		</ul>
		
		<script type="text/javascript">
			document.querySelectorAll("li").forEach(function(liobj){
				liobj.addEventListener("click",function(){
					console.log(this.getAttribute("data-index"));
					
				})
			}) 
		</script>
	</body>
</html>
